package priv.lirenhe.javabase.charpter02;

public class Chapter02 {

	// 命名规则
	private String str01;
	private String str;
	private String _str;
	private String $str;
	// 驼峰式
	private String strHelloWorld;

	// 字符和字符串
	private char c = 'x';
	private char cc = '爱';
	private String s = "xxxx";
	private String s_ = "x";
	// 空字符串，空格字符串 字符串为空
	private String ss = "";
	private String sss = " ";
	private String ssss = null;

	// float和double后缀
	private float f = 0.0f;
	private double d = 0.0d;

	// 强制类型转换
	private int in = 0;
	private short sh = (short) in;

	public Chapter02() {
		System.out.println("构造方法-用于初始化从而生成对象");
	}

	/**
	 * 文档注释 单行注释 多行注释
	 * 
	 * @param args
	 */
	public static void main(String[] args) {
		// 字符串拼接以及转型为字符串
		System.out.println("xxx" + "===");
		int i = 0;
		System.out.println(i + "xxx");
		System.out.println(i + "");

		boolean flag = false;
		if (flag) {
			int a = 0;
			System.out.println(i);
		} else if (flag) {

		} else {

		}
		// 三元运算
		int xx = 0;
		int yy = 1;
		int max;
		if (xx > yy) {
			max = xx;
		} else {
			max = yy;
		}
		//System.out.println(xx>yy ? max =xx : max != yy);

		// switch结构
		int y = 1;
		switch (y) {
		case 1: //
		case 2://
		default://
		}

		// 与以及短路与
		int x;
		int a = 0;
		int b = 0;
		boolean t;
		t = a > 0 & b++ > 0;
		System.out.println(t);
		System.out.println("与，两边都要计算=" + b);

		a = 0;
		b = 0;
		t = a > 0 && b++ > 0;
		System.out.println(t);
		System.out.println("短路与，只计算左边=" + b);

		System.out.println("------------------------------");

		a = 0;
		b = 1;
		t = a++ > 0 && b > 0;
		System.out.println(t);
		System.out.println("后自增=" + a);

		a = 0;
		b = 1;
		t = ++a > 0 && b > 0;
		System.out.println(t);
		System.out.println("先自增=" + a);

		
		for(int ii=0;ii<5;ii++){
			//xxxx
			//continue;
			break;
		}
		boolean flagg = false;
		while(flagg){
			
		}
		
		do{
			
		}while(flagg);
		
		String[] strs = new String[100];
		for(String str : strs){
			System.out.println(str);
		}
		
		Chapter02 obj = new Chapter02();
		obj.returnHelloWorld();
		obj.returnHelloWorld(i);
		obj.returnHelloWorld("");
		
		obj.returnHelloWorld("", i);
		obj.returnHelloWorld(i, "");
		
		// 声明数组
		int array_[] = new int[100];
		int[] array = new int[100];
		int[][] biarray = new int[100][100];

	}

	// 方法重载
	public void returnHelloWorld() {
		System.out.println("001");
	}

	public void returnHelloWorld(int i) {
		return ;
	}

	public void returnHelloWorld(String str) {

	}

	public void returnHelloWorld(String str, int i) {

	}
	public void returnHelloWorld(int i ,String str) {
		
	}

}
